<core:set title='Products'/>
<core:WRAP file="admin_page.html" as="content">

<route_url params="action:create">Create new product</route_url>
<p/>

<active_record:fetch using='src/model/Product' target="products" navigator='pager'/>

<core:include file='pager.html'/>

<form name='list_form' method='post'>
<list:list id="products">
<table cellpadding="0" cellspacing="0" class='list' width='100%'>
  <thead>
  <tr>
    <th>Select</th>
    <th>Title/Image/Price/Description</th>
    <th>Actions</th>
  </tr>
  </thead>
  <list:item>
  <tr>
   <td>
    <input type='checkbox' name='ids[]' value='{$id}' class='input'/>
    <core:optional for='is_available'>
      <img src='images/available.gif' class=''/>
    </core:optional>
    <core:default for='is_available'>
      <img src='images/not_available.gif'/>
    </core:default>
   </td>
   <td>
      <dl>
        <dt>
          <b>{$title}</b><br />
          Price:<b>{$price}</b><br/>

         </dt>
         <dd>
            <img src='{$image_path}' class='img'/>
            {$description|nl2br|raw}
         </dd>
      </dl>

   </td>

   <td>
     <route_url params="action:edit,id:{$id}">Edit</route_url>&nbsp;
     <route_url params="action:delete,id:{$id}">Delete</route_url>
   </td>
  </tr>
  </list:item>
</table>
</list:list>
<input type='hidden' name='action' value='change_availability'/>
<input type='submit' name='set_available' value='Set available'/>
<input type='submit' name='set_not_available' value='Set not available'/>
</form>

</core:wrap>
